/**
 * http://usejsdoc.org/
 */
var http = require("http"),//服务器创建
	querystring = require("querystring");//字符串处理
http.createServer(function(req,res){
	var postData = "";
	/**开始异步接收客户端post数据*/
	req.addListener("data",function(postDataChunk){
		postData += postDataChunk;
	});
	/**异步post数据接收完成后执行匿名回调函数*/
	req.addListener("end",function(){
		var postStr = JSON.stringify(querystring.parse(postData));
		res.writeHead( 200 , {"Content-Type":"text/plain"});
		res.end(postStr +"\n"+ req.method);
	});
}).listen(1337,'127.0.0.1');
console.log("Server running at http://127.0.0.1:1337");